import { Injectable } from '@angular/core';
import {Observable} from "rxjs/Observable";
import {MsgResult} from "../../../../models/msg-result";
import {DamAPI} from "../../peach-constants";
import {RequestUtil} from "../../../../util/request-util";

@Injectable()
export class AssociationMiningService {

  constructor(
    private requestUtil: RequestUtil
  ) { }


  //不同用户不同站点
  getUserSiteData():Observable<MsgResult>{
    return this.requestUtil.get(DamAPI.getUserSite);
  }


  //行政区域列表
  getregionCodeData():Observable<MsgResult>{
    let params = "format=json&minLevel=3";
    return this.requestUtil.get(DamAPI.getregionCodeData,params);
  }

  //站点列表
  getRegionListData(regionCode):Observable<MsgResult>{
    let params = "format=json&searchRegionCode="+regionCode+"&pointType=allAirSite";
    return this.requestUtil.get(DamAPI.getRegionListData,params);
  }

}
